<?php
/*
 *author:Yangligao
 *Date:2013-9-27
 */

require '../../Config.php';
$flag = $_GET['flag'];
$aboutUsModel = new AboutUsModel();
if($flag == 'display'){
	$aboutusData = $aboutUsModel->aboutus_select('');
	$smarty->assign('aboutusData',$aboutusData);
	$smarty->display('Admin/AboutUs/aboutusupdate.html');
}else if($flag == 'update'){

	if($_POST['id'] == ''){//表示为插入
		unset($_POST['x']);
		unset($_POST['y']);
		unset($_POST['id']);
		$res = $aboutUsModel->aboutus_insert($_POST);
		if($res){
			jump('操作成功！', $_SERVER['HTTP_REFERER']);
		}else{
			alertInfo('操作失败！', $_SERVER['HTTP_REFERER']);
		}
	}else{//表示为更新
		unset($_POST['x']);
		unset($_POST['y']);	
		$res = $aboutUsModel->aboutus_update($_POST);	
		if($res){
			jump('操作成功！', $_SERVER['HTTP_REFERER']);
		}else{
			alertInfo('操作失败！', $_SERVER['HTTP_REFERER']);
		}
	}
}
?>
